Skip to content

BUG: swapaxes creating result with read_only array #51945

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 14, 2023

Conversation

phofl
Copy link
Member

@phofl phofl commented Mar 13, 2023

  • closes #xxxx (Replace xxxx with the GitHub issue number)
  • Tests added and passed if fixing a bug or adding a new feature
  • All code checks passed.
  • Added type annotations to new arguments/methods/functions.
  • Added an entry in the latest doc/source/whatsnew/vX.X.X.rst file if fixing a bug or adding a new feature.

@phofl phofl added this to the 2.0 milestone Mar 13, 2023
Copy link
Member

@jorisvandenbossche jorisvandenbossche left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

How did you ran into this? Have you been checking places where we access .values in our own implementations? (because if not, that's maybe something I should still do to avoid other cases like this)

@jorisvandenbossche
Copy link
Member

And on another note, we should also just deprecate this method IMO: #51946

@phofl
Copy link
Member Author

phofl commented Mar 13, 2023

I stumbled upon this in #51944.

Checked all usages afterwards, so should be good when all three of them are in

@mroeschke
Copy link
Member

mypy.....................................................................Failed
- hook id: mypy
- duration: 201.84s
- exit code: 1

pandas/core/generic.py:753: error: Item "ExtensionArray" of "Union[ExtensionArray, ndarray[Any, Any]]" has no attribute "swapaxes"  [union-attr]

@phofl phofl merged commit ffc55a0 into pandas-dev:main Mar 14, 2023
meeseeksmachine pushed a commit to meeseeksmachine/pandas that referenced this pull request Mar 14, 2023
@phofl phofl deleted the cow_swapaxes_read_only branch March 14, 2023 13:15
phofl added a commit that referenced this pull request Mar 14, 2023
…h read_only array) (#51962)

Backport PR #51945: BUG: swapaxes creating result with read_only array

Co-authored-by: Patrick Hoefler <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants